package com.azier.kapacitor.script.node;

import com.azier.kapacitor.script.arg.LambdaArg;
import com.azier.kapacitor.script.arg.OriginalArg;

import java.util.ArrayList;

/**
 * 1 * @Author: luoj
 * 2 * @Date: 2019/11/8 11:34
 * 3
 */
public class DeadmanNode extends AbstractNode {
    private static final String name = "deadman";
    //durationLiteral 数据来源为 DurationLiteral类的常量
    protected DeadmanNode(double threshold ,long interval, String durationLiteral,String condition){
        super(new ArrayList<>(),new ArrayList<>(),name);
        this.args.add(new OriginalArg(threshold));
        this.args.add(new OriginalArg(interval + durationLiteral));
        this.args.add(new LambdaArg(condition));
    }
    protected DeadmanNode(double threshold ,long interval, String durationLiteral){
        super(new ArrayList<>(),new ArrayList<>(),name);
        this.args.add(new OriginalArg(threshold));
        this.args.add(new OriginalArg(interval + durationLiteral));
    }
}
